---
title: docker prune
sidebar_label: prune
---

The `moon docker prune` command will reduce the overall filesize of the Docker environment by
installing production only dependencies for projects that were scaffolded, and removing any
applicable extraneous files.

```shell
$ moon docker prune
```

:::info

View the official [Docker usage guide](../../guides/docker) for a more in-depth example of how to
utilize this command.

:::

:::caution

This command _must be_ ran after [`moon docker scaffold`](./scaffold) and is typically ran within a
`Dockerfile`! The [`moon docker file`](./file) command can be used to generate a `Dockerfile`.

:::

### Configuration

- [`docker.prune`](../../config/workspace#prune) in `.moon/workspace.yml`
